package cn.edu.scut.sys.vo;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/**
 * ExceptionRecord entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "exception_record", catalog = "scoredb")
@JsonIgnoreProperties(value={"hibernateLazyInitializer"})
public class ExceptionRecord implements java.io.Serializable {

	private static final long serialVersionUID = 7733570917671961371L;

	// Fields

	private Long id;
	private Leader leader;
	private TrainException trainException;
	private Student student;
	private Integer trainType;

	// Constructors

	/** default constructor */
	public ExceptionRecord() {
	}

	/** full constructor */
	public ExceptionRecord(Leader leader, TrainException trainException,
			Student student, Integer trainType) {
		this.leader = leader;
		this.trainException = trainException;
		this.student = student;
		this.trainType = trainType;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "leaderId")
	public Leader getLeader() {
		return this.leader;
	}

	public void setLeader(Leader leader) {
		this.leader = leader;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "trainExceptionId")
	public TrainException getTrainException() {
		return this.trainException;
	}

	public void setTrainException(TrainException trainException) {
		this.trainException = trainException;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "studentId")
	public Student getStudent() {
		return this.student;
	}

	public void setStudent(Student student) {
		this.student = student;
	}

	@Column(name = "trainType")
	public Integer getTrainType() {
		return this.trainType;
	}

	public void setTrainType(Integer trainType) {
		this.trainType = trainType;
	}

}